<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> Form </title>
	<script type = "text/javascript">
		function showMessage() {
			var message = document.getElementById("firstName").value + " " + document.getElementsByName("textBoxLastName")[0].value;
			message += new Date();
			alert(message);			
		}
		function checkMail() {
			var re = /^[a-zA-Z0-9]+[a-zA-Z0-9_]+@{1}[a-zA-Z]{1,4}.{1}[a-zA-Z]+$/;			
			var match = re.test(document.getElementById("mail").value);			
			if (match == false) {				
				document.getElementById("mailError").innerText = "* invalid";
			} else {
				document.getElementById("mailError").innerText = "";
			}
		}
	</script>
</head>
<body>
	<label for "firstName">First name:</label>
	<input type = "text" id = "firstName" name = "textBoxFirstName" /> <br/>
	<label for "textBoxLastName">Last name:</label>
	<input type = "text" name = "textBoxLastName" /> <br/>
	<label for = "mail">E-mail:</label>
	<input type = "text" id = "mail"/> <span id="mailError" style="color:red;"></span> <br/>
	<button onclick = "showMessage()">Show message</button>	
</body>
</html>
